
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1.6 云配置中心 · Ebook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="zq_sdk@163.com">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tree/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="zipkin-tracing.html" />
    
    
    <link rel="prev" href="spring-hystrix.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"TIME-GATE/","types":["star","watch"],"size":"large"};
    </script>

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../../about_me.html">
            
                <a href="../../about_me.html">
            
                    
                    关于
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../../gitbook_install.html">
            
                <a href="../../gitbook_install.html">
            
                    
                    附:Gitbook安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../">
            
                <a href="../../">
            
                    
                    一 基础理论
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../data_structure/">
            
                <a href="../../data_structure/">
            
                    
                    1 数据结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../../data_structure/11_linear_structure.html">
            
                <a href="../../data_structure/11_linear_structure.html">
            
                    
                    1.1 数组、链表、跳表及字典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1.1" data-path="../../data_structure/111_array.html">
            
                <a href="../../data_structure/111_array.html">
            
                    
                    1.1.1 数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.2" data-path="../../data_structure/112_link_list.html">
            
                <a href="../../data_structure/112_link_list.html">
            
                    
                    1.1.2 链表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.3" data-path="../../data_structure/113_skip_list.html">
            
                <a href="../../data_structure/113_skip_list.html">
            
                    
                    1.1.3 跳表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.4" data-path="../../data_structure/114_dictionary.html">
            
                <a href="../../data_structure/114_dictionary.html">
            
                    
                    1.1.4 字典
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../../data_structure/12_stack_and_queue.html">
            
                <a href="../../data_structure/12_stack_and_queue.html">
            
                    
                    1.2 栈、队列、散列及集合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.2.1" data-path="../../data_structure/121_stack.html">
            
                <a href="../../data_structure/121_stack.html">
            
                    
                    1.2.1 栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.2" data-path="../../data_structure/122_queue.html">
            
                <a href="../../data_structure/122_queue.html">
            
                    
                    1.2.2 队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.3" data-path="../../data_structure/123_hash.html">
            
                <a href="../../data_structure/123_hash.html">
            
                    
                    1.2.3 散列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.4" data-path="../../data_structure/124_set.html">
            
                <a href="../../data_structure/124_set.html">
            
                    
                    1.2.4 集合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="../../data_structure/13_tree_and_forest.html">
            
                <a href="../../data_structure/13_tree_and_forest.html">
            
                    
                    1.3 树与森林
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.3.1" data-path="../../data_structure/131.html">
            
                <a href="../../data_structure/131.html">
            
                    
                    1.3.1 二叉搜索树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3.2" data-path="../../data_structure/132.html">
            
                <a href="../../data_structure/132.html">
            
                    
                    1.3.2 红黑树
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.4" data-path="../../data_structure/14_map.html">
            
                <a href="../../data_structure/14_map.html">
            
                    
                    1.4 图结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.4.1" data-path="../../data_structure/141_minimal_tree.html">
            
                <a href="../../data_structure/141_minimal_tree.html">
            
                    
                    1.4.1 最小生成树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.2" data-path="../../data_structure/142_single_source_shortest_path.html">
            
                <a href="../../data_structure/142_single_source_shortest_path.html">
            
                    
                    1.4.2 单源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.3" data-path="../../data_structure/143_all_source_shortest_path.html">
            
                <a href="../../data_structure/143_all_source_shortest_path.html">
            
                    
                    1.4.3 多源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.4" data-path="../../data_structure/144_max_stream.html">
            
                <a href="../../data_structure/144_max_stream.html">
            
                    
                    1.4.4 最大流
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../">
            
                <a href="../../">
            
                    
                    2 基础算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../../algorithm/21.html">
            
                <a href="../../algorithm/21.html">
            
                    
                    2.1 排序查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../../algorithm/22.html">
            
                <a href="../../algorithm/22.html">
            
                    
                    2.2 动态规划
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../algorithm/distributed_algorithm.html">
            
                <a href="../../algorithm/distributed_algorithm.html">
            
                    
                    3 分布式算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="../../engineering/ci_deplopment/cs/theory.html">
            
                <a href="../../engineering/ci_deplopment/cs/theory.html">
            
                    
                    3.1 一致性模式与理论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="../../algorithm/raft.html">
            
                <a href="../../algorithm/raft.html">
            
                    
                    3.2 Raft协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="../../algorithm/paxos.html">
            
                <a href="../../algorithm/paxos.html">
            
                    
                    3.3 Paxos协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="../../algorithm/gossip.html">
            
                <a href="../../algorithm/gossip.html">
            
                    
                    3.4 Gossip协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="../../engineering/ci_deplopment/cs/plan.html">
            
                <a href="../../engineering/ci_deplopment/cs/plan.html">
            
                    
                    3.5 几种一致性方案
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../optimization_se/">
            
                <a href="../../optimization_se/">
            
                    
                    4 运筹及系统工程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="../../optimization_se/linear_programming.html">
            
                <a href="../../optimization_se/linear_programming.html">
            
                    
                    4.1 线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="../../optimization_se/integer_programming.html">
            
                <a href="../../optimization_se/integer_programming.html">
            
                    
                    4.2 整数规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="../../optimization_se/目标规划.html">
            
                <a href="../../optimization_se/目标规划.html">
            
                    
                    4.3 目标规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="../../optimization_se/非线性规划.html">
            
                <a href="../../optimization_se/非线性规划.html">
            
                    
                    4.4 非线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.5" data-path="../../optimization_se/动态规划.html">
            
                <a href="../../optimization_se/动态规划.html">
            
                    
                    4.5 动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.6" data-path="../../optimization_se/排队论.html">
            
                <a href="../../optimization_se/排队论.html">
            
                    
                    4.6 排队论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.7" data-path="../../optimization_se/博弈论.html">
            
                <a href="../../optimization_se/博弈论.html">
            
                    
                    4.7 博弈论
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二 工程应用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../engineering/design_pattern/">
            
                <a href="../../engineering/design_pattern/">
            
                    
                    1 设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../../engineering/design_pattern/strategy.html">
            
                <a href="../../engineering/design_pattern/strategy.html">
            
                    
                    1.1 策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../../engineering/design_pattern/prototype.html">
            
                <a href="../../engineering/design_pattern/prototype.html">
            
                    
                    1.2 原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../../engineering/design_pattern/singleton.html">
            
                <a href="../../engineering/design_pattern/singleton.html">
            
                    
                    1.3 单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../../engineering/design_pattern/factory.html">
            
                <a href="../../engineering/design_pattern/factory.html">
            
                    
                    1.4 工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../../engineering/design_pattern/bridge.html">
            
                <a href="../../engineering/design_pattern/bridge.html">
            
                    
                    1.5 桥接模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../../engineering/design_pattern/composite.html">
            
                <a href="../../engineering/design_pattern/composite.html">
            
                    
                    1.6 组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../../engineering/design_pattern/facade.html">
            
                <a href="../../engineering/design_pattern/facade.html">
            
                    
                    1.7 门面模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.8" data-path="../../engineering/design_pattern/adapter.html">
            
                <a href="../../engineering/design_pattern/adapter.html">
            
                    
                    1.8 适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.9" data-path="../../engineering/design_pattern/decorator.html">
            
                <a href="../../engineering/design_pattern/decorator.html">
            
                    
                    1.9 装饰者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.10" data-path="../../engineering/design_pattern/flyweight.html">
            
                <a href="../../engineering/design_pattern/flyweight.html">
            
                    
                    1.10 享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.11" data-path="../../engineering/design_pattern/proxy.html">
            
                <a href="../../engineering/design_pattern/proxy.html">
            
                    
                    1.11 代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.12" data-path="../../engineering/design_pattern/middleware.html">
            
                <a href="../../engineering/design_pattern/middleware.html">
            
                    
                    1.12 中间件模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../engineering/network_prag/">
            
                <a href="../../engineering/network_prag/">
            
                    
                    2 网络编程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../engineering/network_prag/socket.html">
            
                <a href="../../engineering/network_prag/socket.html">
            
                    
                    2.1 长连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../engineering/network_prag/mq.html">
            
                <a href="../../engineering/network_prag/mq.html">
            
                    
                    2.2 MQ
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../">
            
                <a href="../">
            
                    
                    3 语言应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" data-path="../nodejs/node.html">
            
                <a href="../nodejs/node.html">
            
                    
                    3.1 Node.js
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1.1" data-path="../nodejs/core.html">
            
                <a href="../nodejs/core.html">
            
                    
                    3.1.1 原理及构成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.2" data-path="../nodejs/async.html">
            
                <a href="../nodejs/async.html">
            
                    
                    3.1.2 异步机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.3" data-path="../nodejs/important.html">
            
                <a href="../nodejs/important.html">
            
                    
                    3.1.3 一些核心概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.4" data-path="../nodejs/koa_web.html">
            
                <a href="../nodejs/koa_web.html">
            
                    
                    3.1.4 web应用: koa框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.5" data-path="../nodejs/koa.html">
            
                <a href="../nodejs/koa.html">
            
                    
                    3.1.5 koa源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.6" data-path="../nodejs/libuv.html">
            
                <a href="../nodejs/libuv.html">
            
                    
                    3.1.6 libuv网络库应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.7" data-path="../nodejs/apm.html">
            
                <a href="../nodejs/apm.html">
            
                    
                    3.1.7 性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.8" data-path="../nodejs/node_spider.html">
            
                <a href="../nodejs/node_spider.html">
            
                    
                    3.1.8 其他: Node爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.9" data-path="../nodejs/node_map_reduce.html">
            
                <a href="../nodejs/node_map_reduce.html">
            
                    
                    3.1.9 其他: Node编写Mapreduce
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" data-path="../c/c_and_plus.html">
            
                <a href="../c/c_and_plus.html">
            
                    
                    3.2 C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.2.1" data-path="../c/oop.html">
            
                <a href="../c/oop.html">
            
                    
                    3.2.1 面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.2" data-path="../c/ipcs.html">
            
                <a href="../c/ipcs.html">
            
                    
                    3.2.2 进程通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.3" data-path="../c/thread.html">
            
                <a href="../c/thread.html">
            
                    
                    3.2.3 线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.4" data-path="../c/memory.html">
            
                <a href="../c/memory.html">
            
                    
                    3.2.4 内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.5" data-path="../c/network.html">
            
                <a href="../c/network.html">
            
                    
                    3.2.5 网络编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.6" data-path="../c/build_tool.html">
            
                <a href="../c/build_tool.html">
            
                    
                    3.2.6 构建工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.7" data-path="../c/thread_pool.html">
            
                <a href="../c/thread_pool.html">
            
                    
                    3.2.7 其他: 线程池
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../engineering/ci_deplopment/">
            
                <a href="../../engineering/ci_deplopment/">
            
                    
                    三 搭建部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../engineering/ci_deplopment/test.html">
            
                <a href="../../engineering/ci_deplopment/test.html">
            
                    
                    3.1 测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1.1" data-path="../../engineering/ci_deplopment/test/unit_testing.html">
            
                <a href="../../engineering/ci_deplopment/test/unit_testing.html">
            
                    
                    3.1.1 单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.2" data-path="../../engineering/ci_deplopment/test/stress_testing.html">
            
                <a href="../../engineering/ci_deplopment/test/stress_testing.html">
            
                    
                    3.1.2 压力测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../engineering/ci_deplopment/ci_readme.html">
            
                <a href="../../engineering/ci_deplopment/ci_readme.html">
            
                    
                    3.2 集成
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../../engineering/ci_deplopment/ci/gitlab_ci.html">
            
                <a href="../../engineering/ci_deplopment/ci/gitlab_ci.html">
            
                    
                    3.2.1 GitLab CI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../../engineering/ci_deplopment/ci/spinnaker.html">
            
                <a href="../../engineering/ci_deplopment/ci/spinnaker.html">
            
                    
                    3.2.2 Spinnaker
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../engineering/ci_deplopment/build.html">
            
                <a href="../../engineering/ci_deplopment/build.html">
            
                    
                    3.3 部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="../../engineering/ci_deplopment/k8s/k8s.html">
            
                <a href="../../engineering/ci_deplopment/k8s/k8s.html">
            
                    
                    3.3.1 k8s
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="../../engineering/ci_deplopment/rancher/rancher.html">
            
                <a href="../../engineering/ci_deplopment/rancher/rancher.html">
            
                    
                    3.3.2 rancher
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="../../engineering/ci_deplopment/swarm/swarm.html">
            
                <a href="../../engineering/ci_deplopment/swarm/swarm.html">
            
                    
                    3.3.3 swarm
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../../engineering/ci_deplopment/maintenance.html">
            
                <a href="../../engineering/ci_deplopment/maintenance.html">
            
                    
                    3.4 监控
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.4.1" data-path="../../engineering/ci_deplopment/monitor.html">
            
                <a href="../../engineering/ci_deplopment/monitor.html">
            
                    
                    3.4.1 容器监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.2" data-path="../../engineering/ci_deplopment/trace.html">
            
                <a href="../../engineering/ci_deplopment/trace.html">
            
                    
                    3.4.2 系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3" data-path="../../engineering/ci_deplopment/app1.md">
            
                <span>
            
                    
                    3.4.2 应用监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../../engineering/ha/ha.html">
            
                <a href="../../engineering/ha/ha.html">
            
                    
                    3.5 高可用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.5.1" data-path="../../engineering/ha/client.html">
            
                <a href="../../engineering/ha/client.html">
            
                    
                    3.5.1 接入层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.2" data-path="../../engineering/ha/service.html">
            
                <a href="../../engineering/ha/service.html">
            
                    
                    3.5.2 服务层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.3" data-path="../../engineering/ha/share.html">
            
                <a href="../../engineering/ha/share.html">
            
                    
                    3.5.3 存储层高可用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../../engineering/ci_deplopment/hc/hc.html">
            
                <a href="../../engineering/ci_deplopment/hc/hc.html">
            
                    
                    3.6 高并发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.6.1" data-path="../../engineering/ci_deplopment/hc/dns.html">
            
                <a href="../../engineering/ci_deplopment/hc/dns.html">
            
                    
                    3.6.1 基于DNS的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.2" data-path="../../engineering/ci_deplopment/hc/lvs.html">
            
                <a href="../../engineering/ci_deplopment/hc/lvs.html">
            
                    
                    3.6.2 基于Lvs的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.3" data-path="../../engineering/ci_deplopment/hc/haproxy.html">
            
                <a href="../../engineering/ci_deplopment/hc/haproxy.html">
            
                    
                    3.6.3 基于haproxy的负载均衡
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    四 架构模式
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" >
            
                <span>
            
                    
                    1 微服务架构设计与实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="spring-cloud.html">
            
                <a href="spring-cloud.html">
            
                    
                    1.1 微服务概况
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="spring-eureka.html">
            
                <a href="spring-eureka.html">
            
                    
                    1.2 服务注册及发现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="spring-feign.html">
            
                <a href="spring-feign.html">
            
                    
                    1.3 服务调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.4" data-path="spring-zuul.html">
            
                <a href="spring-zuul.html">
            
                    
                    1.4 网关及负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.5" data-path="spring-hystrix.html">
            
                <a href="spring-hystrix.html">
            
                    
                    1.5 熔断、限流、扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.1.6" data-path="spring-config.html">
            
                <a href="spring-config.html">
            
                    
                    1.6 云配置中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.7" data-path="zipkin-tracing.html">
            
                <a href="zipkin-tracing.html">
            
                    
                    1.7 分布式链路追踪
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.8" data-path="swagger.html">
            
                <a href="swagger.html">
            
                    
                    1.8 接口文档管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../domain/">
            
                <a href="../../domain/">
            
                    
                    2 领域驱动模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="../../domain/domain.html">
            
                <a href="../../domain/domain.html">
            
                    
                    2.1 领域--Domain
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.2" data-path="../../domain/entity.md">
            
                <span>
            
                    
                    2.2 领域实体--Entity
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.3" data-path="../../domain/object.html">
            
                <a href="../../domain/object.html">
            
                    
                    2.3 值对象--Value Object
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.4" data-path="../../domain/aggregate.html">
            
                <a href="../../domain/aggregate.html">
            
                    
                    2.4 聚合--Aggregate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.5" data-path="../../domain/service.html">
            
                <a href="../../domain/service.html">
            
                    
                    2.5 服务--Services
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.6" data-path="../../domain/event.html">
            
                <a href="../../domain/event.html">
            
                    
                    2.6 领域事件--Event
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.7" data-path="../../domain/framework.html">
            
                <a href="../../domain/framework.html">
            
                    
                    2.7 几种常见的DDD架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" >
            
                <span>
            
                    
                    3 架构技术的演化与趋势
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" >
            
                <span>
            
                    
                    3.1 架构技术的发展历史及现状
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.2" >
            
                <span>
            
                    
                    3.2 Serverless无服务架构概念
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.3" >
            
                <span>
            
                    
                    3.3 ServerMesh网格服务概念
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    五 其他
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../story/talk.html">
            
                <a href="../../story/talk.html">
            
                    
                    5.1 小伙子,放松!
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >1.6 云配置中心</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x4E00;&#x3001;&#x4E91;&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x7B80;&#x4ECB;">&#x4E00;&#x3001;&#x4E91;&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x7B80;&#x4ECB;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x5E38;&#x7528;&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x6709;spring cloud&#xFF0C;ctrip apollo(&#x643A;&#x7A0B;&#x5F00;&#x6E90;)&#xFF0C;&#x5B83;&#x4EEC;&#x5747;&#x8D77;&#x5230;&#x7EDF;&#x4E00;&#x914D;&#x7F6E;&#x6CBB;&#x7406;&#x4F5C;&#x7528;&#xFF0C;&#x5F15;&#x5165;&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x9664;&#x8003;&#x8651;&#x539F;&#x6709;&#x9879;&#x76EE;&#x7684;&#x517C;&#x5BB9;&#x6027;&#x5916;&#xFF0C;&#x8FD8;&#x9700;&#x8003;&#x8651;&#x6613;&#x7528;&#x6027;&#x548C;&#x53EF;&#x7528;&#x6027;&#x3002;spring config&#x4F5C;&#x4E3A;spring cloud&#x539F;&#x751F;&#x4E00;&#x5458;&#xFF0C;&#x4F7F;&#x7528;git&#x3001;svn&#x7B49;&#x4F5C;&#x4E3A;&#x7248;&#x672C;&#x63A7;&#x5236;&#xFF0C;&#x53EF;&#x4F9D;&#x9760;Eureka&#x3001;k8s service&#x7B49;&#x5B9E;&#x73B0;&#x9AD8;&#x53EF;&#x7528;&#xFF0C;&#x5E76;&#x652F;&#x6301;yaml&#x3001;json&#x3001;Mysql&#x7B49;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;&#x3002;</p>
<p><img src="http://cdn.find-world.top/config_1.png" alt="config"></p>
<h3 id="&#x4E8C;&#x3001;&#x642D;&#x5EFA;config-server">&#x4E8C;&#x3001;&#x642D;&#x5EFA;Config Server</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x672C;&#x6587;&#x5B9E;&#x73B0;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x4E09;&#x79CD;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;&#xFF0C;&#x9996;&#x5148;&#x7F16;&#x5199;build.gradle&#x5F15;&#x5165;&#x4F9D;&#x8D56;:</p>
<pre><code class="lang-js">dependencies {
    compile <span class="hljs-string">&apos;org.springframework.cloud:spring-cloud-config-server&apos;</span>
    compile <span class="hljs-string">&apos;org.springframework.boot:spring-boot-starter-actuator&apos;</span>
    compile <span class="hljs-string">&apos;org.springframework.cloud:spring-cloud-starter-bus-amqp&apos;</span>
    compile <span class="hljs-string">&apos;org.springframework.boot:spring-boot-starter-jdbc&apos;</span>
    compile <span class="hljs-string">&apos;org.springframework.boot:spring-boot-starter-parent:1.5.11.RELEASE&apos;</span>
    compile <span class="hljs-string">&apos;mysql:mysql-connector-java:5.1.21&apos;</span>
}
</code></pre>
<ul>
<li>2.1 &#x672C;&#x5730;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;application.yml&#x6587;&#x4EF6;&#x5982;&#x4E0B;:</p>
<pre><code class="lang-yml"><span class="hljs-attr">server:</span>
<span class="hljs-attr">  port:</span> <span class="hljs-number">8888</span>
<span class="hljs-attr">spring:</span>
<span class="hljs-attr">  cloud:</span>
<span class="hljs-attr">    config:</span>
<span class="hljs-attr">      server:</span>
<span class="hljs-attr">        native:</span>
<span class="hljs-attr">          searchLocations:</span> file:/Users/dreamboad/demo/spero-spring-demo/demo-server
<span class="hljs-attr">  rabbitmq:</span>
<span class="hljs-attr">    host:</span> <span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>
<span class="hljs-attr">    port:</span> <span class="hljs-number">5672</span>
<span class="hljs-attr">    username:</span> user
<span class="hljs-attr">    password:</span> pwd
<span class="hljs-attr">    virtual-host:</span> user
</code></pre>
<p>Spring Cloud <code>application.java</code> &#x6587;&#x4EF6;:</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> com.joseph.config.server;

<span class="hljs-keyword">import</span> org.springframework.boot.SpringApplication;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.EnableAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.cloud.config.server.EnableConfigServer;
<span class="hljs-keyword">import</span> org.springframework.context.annotation.Configuration;

<span class="hljs-meta">@Configuration</span>
<span class="hljs-meta">@EnableConfigServer</span>
<span class="hljs-meta">@EnableAutoConfiguration</span>(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ConfigServerApplication</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        SpringApplication.run(ConfigServerApplication.class, args);
    }
}
</code></pre>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x914D;&#x7F6E;&#x4E00;&#x4E2A;eureka-server-primary&#x672C;&#x5730;&#x6587;&#x4EF6;&#xFF0C;&#x901A;&#x8FC7;config server&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x83B7;&#x53D6;&#xFF0C;<code>curl http://spero-config-server:8888/eureka-server-primary.yml</code>&#x5982;&#x4E0B;:</p>
<pre><code class="lang-yml"><span class="hljs-attr">eureka:</span>
<span class="hljs-attr">  client:</span>
<span class="hljs-attr">    serviceUrl:</span>
<span class="hljs-attr">      defaultZone:</span> http://spero-eureka-server:<span class="hljs-number">8022</span>/eureka/,http://spero-eureka-server:<span class="hljs-number">8023</span>/eureka/
<span class="hljs-attr">  instance:</span>
<span class="hljs-attr">    hostname:</span> spero-eureka-server
<span class="hljs-attr">server:</span>
<span class="hljs-attr">  port:</span> <span class="hljs-number">8021</span>
<span class="hljs-attr">spring:</span>
<span class="hljs-attr">  application:</span>
<span class="hljs-attr">    name:</span> eureka-server-clustered-primary
</code></pre>
<ul>
<li>2.2 Git&#x4ED3;&#x5E93;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;application.yml&#x6587;&#x4EF6;&#x5982;&#x4E0B;:</p>
<pre><code class="lang-yml"><span class="hljs-attr">server:</span>
<span class="hljs-attr">  port:</span> <span class="hljs-number">8888</span>
<span class="hljs-attr">spring:</span>
<span class="hljs-attr">  cloud:</span>
<span class="hljs-attr">    config:</span>
<span class="hljs-attr">      server:</span>
<span class="hljs-attr">        git:</span>
<span class="hljs-attr">          uri:</span> https://github.com/TIME-GATE/spring-boot-api.git
<span class="hljs-attr">          search-paths:</span> configurations
<span class="hljs-attr">          username:</span> user
<span class="hljs-attr">          password:</span> pwd
<span class="hljs-attr">          default-label:</span> dev
<span class="hljs-attr">  rabbitmq:</span>
<span class="hljs-attr">    host:</span> <span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>
<span class="hljs-attr">    port:</span> <span class="hljs-number">5672</span>
<span class="hljs-attr">    username:</span> user
<span class="hljs-attr">    password:</span> user
<span class="hljs-attr">    virtual-host:</span> user
</code></pre>
<p>Spring Cloud <code>application.java</code> &#x6587;&#x4EF6;:</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> com.joseph.config.server;

<span class="hljs-keyword">import</span> org.springframework.boot.SpringApplication;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.EnableAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
<span class="hljs-keyword">import</span> org.springframework.cloud.config.server.EnableConfigServer;
<span class="hljs-keyword">import</span> org.springframework.context.annotation.Configuration;

<span class="hljs-meta">@Configuration</span>
<span class="hljs-meta">@EnableConfigServer</span>
<span class="hljs-meta">@EnableAutoConfiguration</span>(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ConfigServerApplication</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        SpringApplication.run(ConfigServerApplication.class, args);
    }
}
</code></pre>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x914D;&#x7F6E;&#x4E00;&#x4E2A;eureka-server-primary&#x672C;&#x5730;&#x6587;&#x4EF6;&#xFF0C;&#x901A;&#x8FC7;config server&#x914D;&#x7F6E;&#x4E2D;&#x5FC3;&#x83B7;&#x53D6;&#xFF0C;<code>curl http://spero-config-server:8888/eureka-server-primary.yml</code>&#x5982;&#x4E0B;:</p>
<pre><code class="lang-yml"><span class="hljs-attr">eureka:</span>
<span class="hljs-attr">  client:</span>
<span class="hljs-attr">    serviceUrl:</span>
<span class="hljs-attr">      defaultZone:</span> http://spero-eureka-server:<span class="hljs-number">8022</span>/eureka/,http://spero-eureka-server:<span class="hljs-number">8023</span>/eureka/
<span class="hljs-attr">  instance:</span>
<span class="hljs-attr">    hostname:</span> spero-eureka-server
<span class="hljs-attr">server:</span>
<span class="hljs-attr">  port:</span> <span class="hljs-number">8021</span>
<span class="hljs-attr">spring:</span>
<span class="hljs-attr">  application:</span>
<span class="hljs-attr">    name:</span> eureka-server-clustered-primary
</code></pre>
<ul>
<li>2.3 Mysql&#x5B58;&#x50A8;&#x65B9;&#x5F0F;</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;application.yml&#x6587;&#x4EF6;&#x5982;&#x4E0B;:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">spring:</span>
<span class="hljs-attr">  application:</span>
<span class="hljs-attr">    name:</span> config-server
<span class="hljs-attr">  profiles:</span>
<span class="hljs-attr">    active:</span> jdbc
<span class="hljs-attr">  cloud:</span>
<span class="hljs-attr">    config:</span>
<span class="hljs-attr">      server:</span>
<span class="hljs-attr">        default-label:</span> dev
<span class="hljs-attr">        jdbc:</span>
<span class="hljs-attr">          sql:</span> SELECT `key`, `value` FROM `bootstrap_config` where `APPLICATION`=? and `PROFILE`=? and `LABEL`=?

  <span class="hljs-comment"># mysql&#x914D;&#x7F6E;</span>
<span class="hljs-attr">  datasource:</span>
<span class="hljs-attr">    driver-class-name:</span> com.mysql.jdbc.Driver
<span class="hljs-attr">    url:</span> jdbc:mysql://<span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>:<span class="hljs-number">3306</span>/config_service?characterEncoding=utf<span class="hljs-bullet">-8</span>&amp;useSSL=<span class="hljs-literal">false</span>
<span class="hljs-attr">    username:</span> root
<span class="hljs-attr">    password:</span> root
</code></pre>
<p>Spring Cloud <code>application.java</code> &#x6587;&#x4EF6;:</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> com.ytx.config.server;

<span class="hljs-keyword">import</span> org.springframework.boot.SpringApplication;
<span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.SpringBootApplication;
<span class="hljs-keyword">import</span> org.springframework.cloud.config.server.EnableConfigServer;
<span class="hljs-keyword">import</span> org.springframework.context.ApplicationContext;
<span class="hljs-keyword">import</span> org.springframework.jdbc.core.JdbcTemplate;

<span class="hljs-meta">@EnableConfigServer</span>
<span class="hljs-meta">@SpringBootApplication</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ConfigServerApplication</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        ApplicationContext context = SpringApplication.run(ConfigServerApplication.class, args);

        JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class);
    }

}
</code></pre>
<p>&#x521B;&#x5EFA;&#x6570;&#x636E;&#x5E93;<code>bootstrap_config</code>&#x5E76;&#x63D2;&#x5165;&#x914D;&#x7F6E;&#x6570;&#x636E;:</p>
<pre><code class="lang-js">DROP TABLE IF EXISTS <span class="hljs-string">`bootstrap_config`</span>;
CREATE TABLE IF NOT EXISTS <span class="hljs-string">`bootstrap_config`</span> (
   <span class="hljs-string">`key`</span> VARCHAR(<span class="hljs-number">250</span>) NOT NULL,
   <span class="hljs-string">`value`</span> VARCHAR(<span class="hljs-number">250</span>) NOT NULL,
   <span class="hljs-string">`application`</span> VARCHAR(<span class="hljs-number">50</span>) NOT NULL,
   <span class="hljs-string">`profile`</span> VARCHAR(<span class="hljs-number">250</span>) NOT NULL,
   <span class="hljs-string">`label`</span> VARCHAR(<span class="hljs-number">250</span>) NOT NULL DEFAULT <span class="hljs-string">&apos;dev&apos;</span>,
   <span class="hljs-string">`version`</span> INT(<span class="hljs-number">11</span>) NOT NULL DEFAULT <span class="hljs-string">&apos;0&apos;</span>,
   <span class="hljs-string">`status`</span> TINYINT(<span class="hljs-number">4</span>) NOT NULL DEFAULT <span class="hljs-string">&apos;0&apos;</span>
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO <span class="hljs-string">`bootstrap_config`</span> (<span class="hljs-string">`key`</span>, <span class="hljs-string">`value`</span>, <span class="hljs-string">`application`</span>, <span class="hljs-string">`profile`</span>, <span class="hljs-string">`label`</span>) VALUES (<span class="hljs-string">&apos;key1&apos;</span>, <span class="hljs-string">&apos;config-demo-1&apos;</span>, <span class="hljs-string">&apos;config-demo&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>);
INSERT INTO <span class="hljs-string">`bootstrap_config`</span> (<span class="hljs-string">`key`</span>, <span class="hljs-string">`value`</span>, <span class="hljs-string">`application`</span>, <span class="hljs-string">`profile`</span>, <span class="hljs-string">`label`</span>) VALUES (<span class="hljs-string">&apos;key2&apos;</span>, <span class="hljs-string">&apos;config-demo-2&apos;</span>, <span class="hljs-string">&apos;config-demo&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>);
INSERT INTO <span class="hljs-string">`bootstrap_config`</span> (<span class="hljs-string">`key`</span>, <span class="hljs-string">`value`</span>, <span class="hljs-string">`application`</span>, <span class="hljs-string">`profile`</span>, <span class="hljs-string">`label`</span>) VALUES (<span class="hljs-string">&apos;key3&apos;</span>, <span class="hljs-string">&apos;config-demo-3&apos;</span>, <span class="hljs-string">&apos;config-demo&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>, <span class="hljs-string">&apos;dev&apos;</span>);
</code></pre>
<p>curl <code>127.0.0.1:8888/config-demo/dev/dev</code></p>
<pre><code class="lang-json">{
    <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;config-demo&quot;</span>,
    <span class="hljs-string">&quot;profiles&quot;</span>: [
        <span class="hljs-string">&quot;dev&quot;</span>
    ],
    <span class="hljs-string">&quot;label&quot;</span>: <span class="hljs-string">&quot;dev&quot;</span>,
    <span class="hljs-string">&quot;version&quot;</span>: <span class="hljs-literal">null</span>,
    <span class="hljs-string">&quot;state&quot;</span>: <span class="hljs-literal">null</span>,
    <span class="hljs-string">&quot;propertySources&quot;</span>: [
        {
            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;config-demo-dev&quot;</span>,
            <span class="hljs-string">&quot;source&quot;</span>: {
                <span class="hljs-string">&quot;key1&quot;</span>: <span class="hljs-string">&quot;config-demo-1&quot;</span>,
                <span class="hljs-string">&quot;key2&quot;</span>: <span class="hljs-string">&quot;config-demo-2&quot;</span>,
                <span class="hljs-string">&quot;key3&quot;</span>: <span class="hljs-string">&quot;config-demo-3&quot;</span>
            }
        }
    ]
}
</code></pre>
<p>&#x6CE8;&#x610F;:</p>
<pre><code>1&#x3001;yaml&#x683C;&#x5F0F;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x53EF;&#x4EE5;yaml&#x3001;json&#x4E24;&#x79CD;&#x6570;&#x636E;&#x683C;&#x5F0F;&#x8FD4;&#x56DE;&#xFF0C;
2&#x3001;json&#x683C;&#x5F0F;&#x914D;&#x7F6E;&#x53EA;&#x80FD;&#x4EE5;json&#x65B9;&#x5F0F;&#x8FD4;&#x56DE;&#xFF0C;&#x4E14;&#x9700;&#x8981;&#x5F62;&#x5982; localhost:8888/*/*/dev/swagger-demo.json &#x7684;&#x8BF7;&#x6C42;
3&#x3001;config server&#x9ED8;&#x8BA4;&#x4E0D;&#x7F13;&#x5B58;&#x5F53;&#x524D;&#x914D;&#x7F6E;&#x4FE1;&#x606F;&#x3001;&#x5373;&#x6BCF;&#x6B21;&#x63D0;&#x4EA4;&#x7684;&#x914D;&#x7F6E;&#x4FE1;&#x606F;&#x5B9E;&#x65F6;&#x751F;&#x6548;
4&#x3001;config server&#x7684;&#x9AD8;&#x53EF;&#x7528;&#x57FA;&#x4E8E;Eureka&#x6216;k8s service&#x5B9E;&#x73B0;&#xFF0C;&#x914D;&#x7F6E;&#x5B58;&#x50A8;&#x5982;git server&#x7B49;&#x9AD8;&#x53EF;&#x7528;&#x9700;&#x8981;&#x81EA;&#x884C;&#x5B9E;&#x73B0;
</code></pre><h3 id="&#x4E09;&#x3001;&#x914D;&#x7F6E;&#x70ED;&#x5237;&#x65B0;">&#x4E09;&#x3001;&#x914D;&#x7F6E;&#x70ED;&#x5237;&#x65B0;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;Spring Cloud Bus &#x5C06;&#x5206;&#x5E03;&#x5F0F;&#x7684;&#x8282;&#x70B9;&#x7528;&#x8F7B;&#x91CF;&#x7684;&#x6D88;&#x606F;&#x4EE3;&#x7406;&#x8FDE;&#x63A5;&#x8D77;&#x6765;&#x3002;&#x5B83;&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x5E7F;&#x64AD;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x66F4;&#x6539;&#x6216;&#x8005;&#x670D;&#x52A1;&#x4E4B;&#x95F4;&#x7684;&#x901A;&#x8BAF;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x76D1;&#x63A7;&#xFF0C;&#x5982;&#x5F53;&#x9700;&#x8981;&#x9488;&#x5BF9;&#x67D0;&#x4E2A;&#x5FAE;&#x670D;&#x52A1;&#x66F4;&#x6539;&#x914D;&#x7F6E;&#x65F6;&#xFF0C;&#x4F20;&#x7EDF;&#x7684;&#x505A;&#x6CD5;&#x8D70;&#x90E8;&#x7F72;&#x53D1;&#x5E03;&#xFF0C;&#x4F46;&#x57FA;&#x4E8E;Spring Cloud Bus&#x7684;&#x5B9E;&#x73B0;&#x65B9;&#x5F0F;&#x53EA;&#x9700;&#x8981;&#x66F4;&#x6539;&#x4E91;&#x914D;&#x7F6E;&#xFF0C;&#x901A;&#x8FC7;&#x6D88;&#x606F;&#x603B;&#x7EBF;&#x901A;&#x77E5;&#x4E8B;&#x4EF6;&#xFF0C;&#x5B9E;&#x73B0;&#x670D;&#x52A1;&#x914D;&#x7F6E;&#x7684;&#x70ED;&#x52A0;&#x8F7D;&#x3002;&#x672C;&#x6587;&#x4E3B;&#x8981;&#x5206;&#x4EAB;&#x7528;Spring Cloud Bus&#x5B9E;&#x73B0;&#x901A;&#x77E5;&#x5FAE;&#x670D;&#x52A1;&#x67B6;&#x6784;&#x7684;&#x914D;&#x7F6E;</p>
<p><img src="http://cdn.find-world.top/spring_bus_1.png" alt="config"></p>
<ul>
<li>3.1 &#x5B9E;&#x73B0;</li>
</ul>
<p>&#x6DFB;&#x52A0;&#x4F9D;&#x8D56;&#x5E93;</p>
<pre><code class="lang-java">dependencies {
    compile <span class="hljs-string">&quot;org.springframework.cloud:spring-cloud-starter-config&quot;</span>
    compile <span class="hljs-string">&apos;org.springframework.cloud:spring-cloud-starter-zuul&apos;</span>
    compile <span class="hljs-string">&apos;org.springframework.cloud:spring-cloud-starter-eureka&apos;</span>
    compile(<span class="hljs-string">&apos;org.springframework.cloud:spring-cloud-starter-bus-amqp&apos;</span>)
    compile(group: <span class="hljs-string">&apos;io.github.openfeign&apos;</span>, name: <span class="hljs-string">&apos;feign-httpclient&apos;</span>, version: <span class="hljs-string">&apos;9.5.0&apos;</span>)
    testCompile(<span class="hljs-string">&quot;org.springframework.boot:spring-boot-starter-test&quot;</span>)
}
</code></pre>
<pre><code class="lang-yaml"><span class="hljs-attr">spring:</span>
<span class="hljs-attr">  rabbitmq:</span>
<span class="hljs-attr">    host:</span> <span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>
<span class="hljs-attr">    port:</span> <span class="hljs-number">5672</span>
<span class="hljs-attr">    username:</span> admin
<span class="hljs-attr">    password:</span> admin
<span class="hljs-attr">    virtual-host:</span> user
</code></pre>
<pre><code class="lang-java"><span class="hljs-comment">// destination&#x4EE3;&#x8868;&#x5177;&#x4F53;&#x7684;&#x670D;&#x52A1;</span>
curl -POST http:<span class="hljs-comment">//localhost:8888/bus/refresh?destination=customers:**</span>
</code></pre>
<p>&#x8BF7;&#x6C42;<code>http://localhost:8041/env</code>&#x53D1;&#x73B0;&#x5BF9;&#x5E94;&#x7684;zuul&#x914D;&#x7F6E;&#x5DF2;&#x7ECF;&#x53D1;&#x751F;&#x66F4;&#x65B0;&#x3002;</p>
<h3 id="&#x56DB;&#x3001;&#x603B;&#x7ED3;">&#x56DB;&#x3001;&#x603B;&#x7ED3;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x9664;&#x57FA;&#x4E8E;Git&#x548C;native file&#x7B49;&#x7BA1;&#x7406;&#x914D;&#x7F6E;&#x5916;&#xFF0C;Spring Cloud Config&#x8FD8;&#x652F;&#x6301;mysql&#x7684;&#x914D;&#x7F6E;&#x65B9;&#x5F0F;&#xFF0C;&#x4F46;&#x6B64;&#x79CD;&#x65B9;&#x5F0F;&#x5BF9;&#x4E8E;yaml&#x3001;json&#x7B49;&#x5D4C;&#x5957;&#x7684;&#x89E3;&#x6790;&#x5E76;&#x4E0D;&#x53CB;&#x597D;&#xFF0C;&#x7528;Git&#x8FDB;&#x884C;&#x7248;&#x672C;&#x63A7;&#x5236;&#x65F6;&#xFF0C;Git Server&#x81EA;&#x8EAB;&#x4E5F;&#x53EF;&#x901A;&#x8FC7;NFS&#x5B9E;&#x73B0;&#x5206;&#x5E03;&#x5F0F;&#x3001;&#x9AD8;&#x53EF;&#x7528;&#xFF0C;&#x4E0D;&#x96BE;&#x53D1;&#x73B0;&#x57FA;&#x4E8E;spring config&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#x7BA1;&#x7406;&#x4E0D;&#x5931;&#x4E3A;&#x4E00;&#x79CD;&#x6210;&#x719F;&#x53EF;&#x9760;&#x7684;&#x65B9;&#x6848;&#x3002;</p>
<h3 id="&#x4E94;&#x3001;&#x53C2;&#x8003;">&#x4E94;&#x3001;&#x53C2;&#x8003;</h3>
<ul>
<li><a href="https://cloud.spring.io/spring-cloud-config/1.1.x/" target="_blank">1&#x3001;Spring Cloud Config</a></li>
<li><a href="https://springcloud.cc/spring-cloud-bus.html" target="_blank">2&#x3001;Spring Cloud Bus</a></li>
</ul>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x4E00;&#x84D1;&#x70DF;&#x96E8;&#x4EFB;&#x5E73;&#x751F; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x4FEE;&#x6539;&#x65F6;&#x95F4;: 
2021-04-09 11:09:02
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="spring-hystrix.html" class="navigation navigation-prev " aria-label="Previous page: 1.5 熔断、限流、扩缩容">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="zipkin-tracing.html" class="navigation navigation-next " aria-label="Next page: 1.7 分布式链路追踪">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1.6 云配置中心","level":"1.5.1.6","depth":3,"next":{"title":"1.7 分布式链路追踪","level":"1.5.1.7","depth":3,"path":"program/java/zipkin-tracing.md","ref":"program/java/zipkin-tracing.md","articles":[]},"previous":{"title":"1.5 熔断、限流、扩缩容","level":"1.5.1.5","depth":3,"path":"program/java/spring-hystrix.md","ref":"program/java/spring-hystrix.md","articles":[]},"dir":"ltr"},"config":{"plugins":["disqus","tree","splitter","local-video","chart","github-buttons","tbfed-pagefooter","ace","katex"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 一蓑烟雨任平生","modify_label":"修改时间: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"ace":{},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"repo":"TIME-GATE/","types":["star","watch"],"size":"large"},"local-video":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"tree":{},"chart":{"type":"c3"}},"theme":"default","author":"zq_sdk@163.com","name":"name","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Ebook","language":"zh-hans","gitbook":"*","description":"电子书"},"file":{"path":"program/java/spring-config.md","mtime":"2021-04-09T03:09:02.265Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-10T12:23:44.633Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-tree/jquery.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-tree/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

